1. Field of Invention
The invention relates to a method of processing a digital image and particularly to a method of auto-deskewing a tilted image.
2. Related Art
In scanning an original document with a scanner, the original document is apt to be put in a tilted state, which is generally inconvenient for reading and has to process the scanned original document (inputted image). Therefore, inspection and correction of the tilted state of the inputted image are indispensible. In performing the operation of correction, a tilting angle of the inputted image has to be first inspected and then adjusted on the basis of the tilting angle so that the inputted image may be adjusted to a correct position.
Tilted image correction technology is a method of deskewing a tilted state of an image by inspecting the tilting angle of the tilt image and adjusting the tilting angle to a right angle through grid lines externally applied and textual direction in the image. This correction method may be used independently or used as a pre-process for an optical character recognition (OCR) process.
The image tilt correction method may be classified into a manual correction method and an automatic correction method. The manual correction is generally conducted through observation of the image by a user's eyes. In performing the automatic correction, the image is first analyzed, a tilting angle of the image is obtained, and then the image is automatically corrected from its tilted state. However, some traditional cut-away software used for this tilt correction purpose has the disadvantage of causing the corrected image to have saw-toothed edges.
The prior automatic tilted image correction methods comprise the projection profile method, the Hough transformation method, the cross correlation method, neighboring features clustering method, and so on.
The projection profile method is performed based on a structure energy function and provided a better correction result with respect to the textual areas in the image, but a poorer correction result with respect to the pictorial areas in the image.
The Hough transformation method is performed based on edge inspection and geometrical shape recognition with respect to the image, in which foreground pixels in the image are mapped in a space of the polar coordinates and values of the pixels in the space of the polar coordinates are accumulated so that the titling angle of the image is obtained. Similarly, this method may achieve a better effect only with the textual areas of the image.
The cross correlation method is conducted based on a concept of cross computation and corresponds to an algorithm of higher accuracy. This method provides solutions to the problems of varied main textual direction and blending of pictures and figures in the image. However, the algorithm adopted in this method has less precision.
The neighboring features clustering method is executed based on statistics, in which the problem of interference resulting from the pictorial area and the figure area in the image may be overcome and thus a better result may be obtained. However, since a relatively large textual area in the image is required for performing statistical analysis, an image having insufficient textual area may not have a good result since the insufficient features in the image may not provide sufficient statistical information.
The above-mentioned methods are the basic tilted image correction methods used in the field. Other methods are also available that are combinations of the concepts used in the above methods. From the above descriptions, it may be understood that the above methods have better effects with text images but relatively poor effects with images having larger pictorial and figure areas and smaller textual areas. Therefore, almost all prior tilted image correction methods are performed by relying on the textual areas but not the figure and pictorial areas, which have useful information for tilted image correction. Besides, most of the prior tilt correction methods are performed by making use of detailed contents and relations among the contents of the image but without making most use of a whole structure of the image, in which there is also information useful in determining the tilting angle of the image.
Therefore, there is a need to provide a method of auto-deskewing a tilted image which comprises textual, figure and pictorial areas.